<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<script src="./layui/layui.js"></script>
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/ajaxfileupload.js" charset="GBK"></script>
<link href="layui/css/layui.css" rel="stylesheet">
<style>
  *{
    margin: 0;
    padding: 0;
  }
  #userlist{
    height: 450px;
  }
  #userlist img{
    width: 40px;
    height: 50px;
  }
  #userlist{
  }
</style>
<div id="userlist">
  <table id="usertable"></table>
</div>
</html>
<script type="text/html" id="userimg">
  <img src="{{d.user_img_path}}{{d.user_img_name}}">
</script>
<script>
  layui.use(function(){
    var table = layui.table;
    // 将静态表格进行动态化
    table.render({
      elem: '#usertable'
      ,height: 450
      ,lineStyle: 'height: 80px;'
      ,url: 'getUserList' //数据接口
      ,cols: [[ //表头
        {field: 'userimg', title: 'ID', fixed: 'left',templet: '#userimg'}
        ,{field: 'user_name', title: '用户姓名'}
        ,{field: 'user_status', title: '用户状态'}
        ,{field: 'user_status_time', title: '活跃时间'}
      ]]
    });
  });
</script>